package com.ruoyi.weixin.untils;
/**
 * @Author: KSQC
 * @Description: 基于ThreadLocal对登陆用户信息进行存储和读取
 * @Date: 2023/2/16 22:11
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<Long>();

    public static ThreadLocal<Long> getThreadLocal() {
        return threadLocal;
    }

    public static void setThreadLocal(ThreadLocal<Long> threadLocal) {
        BaseContext.threadLocal = threadLocal;
    }

    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    public static Long getCurrentId(){
        return threadLocal.get();
    }
}